package com.contactmgr.logObjects;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class Contact implements Serializable {
	private static final long serialVersionUID = 7140510446382155891L;

	/**
	 * Defines TYPE of email and phone
	 * 
	 * @author ith
	 * 
	 */
	public enum TYPE {
		HOME, WORK, MOBILE, OTHER, UNKNOWN
	};

	private String contactId;
	private String givenName;
	private String familyName;
	private String displayName;
	private Map<TYPE, String> phones;
	private Map<TYPE, String> emails;

	public Contact() {
		phones = new HashMap<Contact.TYPE, String>();
		emails = new HashMap<Contact.TYPE, String>();
	}

	public void addPhone(Contact.TYPE type, String phone) {
		this.phones.put(type, phone);
	}

	public void addEmail(Contact.TYPE type, String email) {
		this.emails.put(type, email);
	}

	// add others
	public String getContactId() {
		return contactId;
	}

	public void setContactId(String contactId) {
		this.contactId = contactId;
	}

	public String getGivenName() {
		return givenName;
	}

	public void setGivenName(String givenName) {
		this.givenName = givenName;
	}

	public String getFamilyName() {
		return familyName;
	}

	public void setFamilyName(String familyName) {
		this.familyName = familyName;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public Map<TYPE, String> getPhone() {
		return phones;
	}

	public void setPhone(Map<TYPE, String> phone) {
		this.phones = phone;
	}

	public Map<TYPE, String> getEmail() {
		return emails;
	}

	public void setEmail(Map<TYPE, String> email) {
		this.emails = email;
	}

	@Override
	public String toString() {
		return "Contact : \ncontactId=" + contactId + "\ngivenName=" + givenName + "\nfamilyName=" + familyName + "\ndisplayName=" + displayName
				+ "\nphones=" + phones + "\nemails=" + emails;
	}

}
